package com.shengqiang.zhenhuiTransfer.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.FileInputStream;
import java.util.Properties;

public class PropsUtils {

    private static final Logger logger= LoggerFactory.getLogger(PropsUtils.class);

    public static String getCommonPropsVaule(String key){
        String filePath="classpath:common.properties";
        try{
            Properties props=new Properties();
            props.load(new FileInputStream(filePath));
            return props.getProperty(key);
        }catch (Exception ex){
            logger.error("读取配置文件【{}】,出现异常:{}",filePath,ex);
            return null;
        }
    }
}
